<template>
  <el-card
    v-bind="$attrs"
    :header="header"
    :body-style="bodyStyle"
    :shadow="shadow"
    :class="cardClass"
  >
    <template #header v-if="$slots.header">
      <slot name="header" />
    </template>
    <slot />
  </el-card>
</template>

<script>
export default {
  name: 'MyElCard',
  inheritAttrs: false,
  props: {
    header: {
      type: String,
      default: ''
    },
    bodyStyle: {
      type: Object,
      default: () => ({})
    },
    shadow: {
      type: String,
      default: 'always',
      validator: (value) => {
        return ['always', 'hover', 'never'].includes(value)
      }
    },
    cardClass: {
      type: String,
      default: ''
    }
  }
}
</script>

<style scoped>
.el-card {
  margin-bottom: 20px;
}

.el-card:last-child {
  margin-bottom: 0;
}
</style> 